namespace IEstate.Web.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Init : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Estates",
                c => new
                    {
                        EstateID = c.Int(nullable: false, identity: true),
                        UID = c.Int(nullable: false),
                        Street = c.String(),
                        Price = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Size = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Bedrooms = c.Int(nullable: false),
                        ApplicationUser_Id = c.String(maxLength: 128),
                    })
                .PrimaryKey(t => t.EstateID)
                .ForeignKey("dbo.AspNetUsers", t => t.ApplicationUser_Id)
                .Index(t => t.ApplicationUser_Id);
            
            AddColumn("dbo.AspNetUsers", "LastName", c => c.String());
            DropColumn("dbo.AspNetUsers", "customCode");
        }
        
        public override void Down()
        {
            AddColumn("dbo.AspNetUsers", "customCode", c => c.String());
            DropForeignKey("dbo.Estates", "ApplicationUser_Id", "dbo.AspNetUsers");
            DropIndex("dbo.Estates", new[] { "ApplicationUser_Id" });
            DropColumn("dbo.AspNetUsers", "LastName");
            DropTable("dbo.Estates");
        }
    }
}
